#!/usr/bin/env python

'''Application Setup

@author Julot <andy.julot@gmail.com>
@since Saturday, January 14, 2012 09:27:19 AM'''

import os
import app
import sys
import py2exe

from distutils.core import setup

origIsSystemDLL = py2exe.build_exe.isSystemDLL
def isSystemDLL(pathname):
    dlls = ('msvcp71.dll', 'dwmapi.dll')
    if os.path.basename(pathname).lower() in dlls:
        return 0
    return origIsSystemDLL(pathname)
py2exe.build_exe.isSystemDLL = isSystemDLL

# If run without args, build executables, in quiet mode.
if len(sys.argv) == 1:
    sys.argv.append("py2exe")
    sys.argv.append("-q")

py2exe = {'compressed': 1,
          'optimize': 2,
          'bundle_files': 1,
          'excludes': ['javax.comm'],
          'dll_excludes': ['w9xpopen.exe', 'MSVCR71.dll'],
          'includes': [],
          'packages': ['sqlalchemy.dialects.sqlite'],}

setup(options={"py2exe": py2exe}, zipfile=None, windows=[app.Meta()])
